home *** CD-ROM | disk | FTP | other *** search
/ CDUTIL 13 / CDUTIL #13 Julio 1995.iso / windows / acadwin / ads / cpp / adscpp / ddeads / ddeads.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-08  |  4.9 KB  |  133 lines

  1. /* 
  2.     DDEADS.H -
  3.     
  4.     This file:
  5.  
  6.         Declares DDE functions to simulate the DDEADS functions
  7.         in R12.  These functions are not fully implemented, they
  8.         are only used to show the usage of DDE classes.
  9.  
  10.     (C) Copyright 1988-1994 by Autodesk, Inc.
  11.  
  12.     This program is copyrighted by Autodesk, Inc. and is  licensed
  13.     to you under the following conditions.  You may not distribute
  14.     or  publish the source code of this program in any form.   You
  15.     may  incorporate this code in object form in derivative  works
  16.     provided  such  derivative  works  are  (i.) are  designed and
  17.     intended  to  work  solely  with  Autodesk, Inc. products, and
  18.     (ii.)  contain  Autodesk's  copyright  notice  "(C)  Copyright
  19.     1988-1994 by Autodesk, Inc."
  20.  
  21.     AUTODESK  PROVIDES THIS PROGRAM "AS IS" AND WITH  ALL  FAULTS.
  22.     AUTODESK  SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF  MER-
  23.     CHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK,  INC.
  24.     DOES  NOT  WARRANT THAT THE OPERATION OF THE PROGRAM  WILL  BE
  25.     UNINTERRUPTED OR ERROR FREE.
  26.  
  27. */
  28. #ifndef DDEADS_H
  29. #define DDEADS_H
  30.  
  31. #include    "adscpp.h"
  32. #include    "ddeinc.h"
  33.  
  34. //-----------------------------------------------------------------------------
  35. void    fddedlgstart(struct resbuf *);
  36. void    fddedialog(struct resbuf *);
  37. int     fddedrawing(struct resbuf *);
  38. int     fddeblocks(struct resbuf *);
  39. int     fddesset(struct resbuf *);
  40. int     fddeupdate(struct resbuf *);
  41. int     fddeformat(struct resbuf *);
  42. int     fddedefaults(struct resbuf *);
  43. int     doddetransfer( struct resbuf *);
  44.  
  45. //-----------------------------------------------------------------------------
  46. class DDEADS_APP;
  47. class CLIENT_CHANNELS;
  48. class CHANNELS;
  49.  
  50. //-----------------------------------------------------------------------------
  51. class CLIENT_CHANNEL : ADS_OBJ
  52. {
  53.     friend class CHANNELS;
  54.  
  55.     DDE_CLIENT_CONNECTION   *channel;
  56.     CLIENT_CHANNEL          *next;
  57.                             CLIENT_CHANNEL( DDE_CLIENT_CONNECTION * chnl)
  58.                             {
  59.                                 channel = chnl;
  60.                             }
  61.                             ~CLIENT_CHANNEL(){ delete channel; }
  62.     BOOL                    Valid() { return ( channel != NULL ); }
  63.  
  64.     BASIC_CPP_STUFF(CLIENT_CHANNEL)
  65. };
  66.  
  67. //-----------------------------------------------------------------------------
  68. class CHANNELS : ADS_OBJ
  69. {
  70.     friend class DDEADS_APP;
  71.  
  72.     CLIENT_CHANNEL          *head;
  73.     CLIENT_CHANNEL          *tail;
  74.     CLIENT_CHANNEL          *current;
  75.     int                     count;
  76.                             CHANNELS() : tail( NULL ), head( NULL )
  77.                                        , count( 0 ), current( NULL ){}
  78.                             ~CHANNELS()
  79.                             {
  80.                                 while ( head )
  81.                                 {
  82.                                     current = head->next;
  83.                                     delete head;
  84.                                     head = current;
  85.                                 }
  86.                                 count = 0;
  87.                                 head = current = tail = NULL;
  88.                             }
  89.     int                     Add( DDE_CLIENT_CONNECTION* new_connection );
  90.     int                     Remove( int chnl );
  91.     int                     SetCurrent( int chnl )
  92.                             {
  93.                                 ASSERT( chnl < count );
  94.                                 current = head;
  95.                                 while( --chnl )
  96.                                 {
  97.                                     current = current->next;
  98.                                 }
  99.                                 return chnl;
  100.                             }
  101.     BOOL                    Valid() { return ( head != NULL  ); }
  102.     DDE_CLIENT_CONNECTION   *Current()
  103.                             {
  104.                                 return ( ( current ) ? ( current->channel ) : NULL );
  105.                             }
  106.  
  107.     BASIC_CPP_STUFF(CHANNELS)
  108. };
  109.  
  110. //-----------------------------------------------------------------------------
  111. class DDEADS_APP : public ADS_APP
  112. {
  113.     CHANNELS                channels;
  114. public:
  115.     DDE_CLIENT_CONNECTION*  CurChannel() 
  116.                             { 
  117.                                 return channels.Current(); 
  118.                             }
  119.     int                     AddChannel( DDE_CLIENT_CONNECTION* conx )
  120.                             {
  121.                                 return channels.Add( conx );
  122.                             }
  123.     int                     ExportDrawing();
  124.     BOOL                    ImportDrawing();
  125.     BOOL                    StartHotLink();
  126.                             DDEADS_APP( int argc, char **argv );
  127.                             ~DDEADS_APP(){}
  128. private:
  129.     BASIC_CPP_STUFF( DDEADS_APP )
  130. };
  131.  
  132. #endif
  133.